﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_Airfare : System.Web.UI.Page
{
    AirfareBusiness ab = new AirfareBusiness();
    protected void Page_Load(object sender, EventArgs e)
    {
        bindGV();
    }
    public void bindGV()
    {
        GridView1.DataSource = ab.getAllAirfare();
        GridView1.DataBind();
    }
    protected void lbEdit_Click(object sender, EventArgs e)
    {
        Response.Redirect("AirfareEdit.aspx?airfareID="+((LinkButton)sender).CommandArgument);
    }
    protected void lbDelete_Click(object sender, EventArgs e)
    {
        if (ab.Delete(int.Parse(((LinkButton)sender).CommandArgument)))
            Response.Redirect("Airfare.aspx");
        else
            Label1.Text = "không xóa được";

    }
}